Cube with anechoic condition (Interior)
Importing related packages
using BoundaryIntegralEquations # For BIEs
using IterativeSolvers # For gmres
using LinearAlgebra # For Diagonal
using Plots # For 2d plots
using Meshes # For 3d mesh plots
import WGLMakie as wgl # WGLMakie integrates into VSCode. Other backends can also be used.
wgl.set_theme!(resolution=(800, 800))Setting up constants
frequency = 54.59; # Frequency [Hz]
c = 343; # Speed up sound [m/s]
ρ₀ = 1.21; # Mean density [kg/m^3]
Z₀ = ρ₀*c; # Characteristic impedance [Rayl]
P₀ = 1.0; # Pressure of plane wave [m/s]
l = 1.0; # Length of cube [m]
k = 2π*frequency/c; # Computing the wavenumberLoading Mesh
Loading and visualizing the triangular cube mesh
mesh_file = joinpath(dirname(pathof(BoundaryIntegralEquations)),"..","examples","meshes","1m_cube_extra_coarse");
physics_orders = [:linear,:geometry,:disctriconstant,:disctrilinear,:disctriquadratic];
mesh = load3dTriangularComsolMesh(mesh_file;geometry_order=:linear, physics_order=physics_orders[5])
bc_pre = [1] .- 1; # The .-1 is due to COMSOL 0-indexing of exported entities
bc_ane = [6] .- 1; # The .-1 is due to COMSOL 0-indexing of exported entitiesCreating simple meshes for full mesh and boundary condition
simple_mesh = create_bc_simple_mesh(mesh,[bc_pre; bc_ane],false);
simple_pre = create_bc_simple_mesh(mesh,bc_pre);
simple_ana = create_bc_simple_mesh(mesh,bc_ane);We now plot the mesh with the pressure condition shown in red and the anechoic condition shown in blue
viz(simple_pre;showfacets=true,color=:red)
viz!(simple_mesh;showfacets=true,alpha=0.1)
viz!(simple_ana;showfacets=true,color=:blue)
wgl.current_figure()